Skip to content

ci: reduce pull request build matrices - #2581

Open
ousamabenyounes wants to merge 1 commit into
php:mainfrom
ousamabenyounes:fix-2580-reduce-pr-build-matrix
Open

ci: reduce pull request build matrices#2581
ousamabenyounes wants to merge 1 commit into
php:mainfrom
ousamabenyounes:fix-2580-reduce-pr-build-matrix

Conversation

@ousamabenyounes

Copy link
Copy Markdown
Contributor

Fixes #2580.

What changed

  • Added .github/scripts/ci-build-matrix.sh to centralize Docker/static build matrix selection.
  • Pull requests without the full-build-matrix label now run a reduced build matrix:
    • Docker images: one bookworm variant per PHP version on linux/amd64.
    • Static binaries: linux/amd64 only.
  • Pushes, schedules, releases, manual runs, and PRs labeled full-build-matrix keep the full matrix.

RED

.github/scripts/ci-build-matrix-test.sh

.github/scripts/ci-build-matrix-test.sh: line 12: .github/scripts/ci-build-matrix.sh: No such file or directory

GREEN

.github/scripts/ci-build-matrix-test.sh
bash -n .github/scripts/ci-build-matrix.sh .github/scripts/ci-build-matrix-test.sh
docker run --rm --label com.ora.cleanup.scope=contribute -v "$PWD":/work -w /work mikefarah/yq:4.47.2 '.name' .github/workflows/docker.yaml .github/workflows/static.yaml\n\nBuild Docker Images\n---\nBuild binary releases\n```\n\n## Matrix smoke checks\n```\nMETADATA="$(docker buildx bake --print | jq -c)" .github/scripts/ci-build-matrix.sh docker false\nvariants=["php-8-2-bookworm","php-8-3-bookworm","php-8-4-bookworm","php-8-5-bookworm"]\nplatforms=["linux/amd64"]\n\nMETADATA="$(docker buildx bake --print static-builder-musl | jq -c)" .github/scripts/ci-build-matrix.sh static false\nplatforms=["linux/amd64"]\n```

@ousamabenyounes

Copy link
Copy Markdown
Contributor Author

Follow-up pushed in 0846ef4 for the failing CI jobs:

  • Build Docker Images / prepare was still computing base fingerprints from the full bake metadata on PRs, so it tried to inspect php:8.4.24-zts-alpine, which does not exist. The fingerprint step now receives the same FULL_BUILD_MATRIX flag and filters to Bookworm targets for reduced PR runs.
  • Lint Code Base reported editorconfig indentation in ci-build-matrix-test.sh and shfmt changes in ci-build-matrix.sh; both are fixed.

Local validation:

  • bash .github/scripts/ci-build-matrix-test.sh
  • bash -n .github/scripts/ci-build-matrix.sh .github/scripts/ci-build-matrix-test.sh .github/scripts/docker-compute-fingerprints.sh
  • pinned mvdan/shfmt:v3.12.0 -d on the touched shell scripts
  • pinned mstruebing/editorconfig-checker:v3.4.0 on the touched shell scripts
  • mocked docker/skopeo run of docker-compute-fingerprints.sh with FULL_BUILD_MATRIX=false, confirming it inspects only php:8.4.99-zts-bookworm and never the Alpine tag

@ousamabenyounes
ousamabenyounes force-pushed the fix-2580-reduce-pr-build-matrix branch 2 times, most recently from 6982573 to 5bd8c59 Compare August 15, 2026 22:43
Pull requests without the full-build-matrix label now build a reduced
docker/static matrix (one bookworm variant per PHP version on
linux/amd64), while pushes, schedules, releases, manual runs and
labeled PRs keep the full matrix.

Fixes php#2580.
@ousamabenyounes
ousamabenyounes force-pushed the fix-2580-reduce-pr-build-matrix branch from 5bd8c59 to d725698 Compare August 16, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

don't rebuild full docker/binary matrix every pull request

1 participant